package test;

public class Goods {
	private String name;
	int price;
	public Goods() {
	}
	public Goods(String name,int price) {
		this.name=name;
		this.price=price;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getPrice() {
		return price;
	}
	public void setPrice(int price) {
		this.price = price;
	}
	@Override
	public int hashCode() {
		String info=name+Integer.toString(price);
		return info.hashCode();
	}
	@Override
	public boolean equals(Object obj) {
		Goods goods=(Goods)obj;
		if(this.name.equals(goods.name)&&this.price==goods.price) {
			return true;
		}else {
			return false;
		}
	}
}
